ls /dev/sda* -lFhart
# Major: Driver
# Minor: Kernel uses to determine exactly which device refered to
ls /dev/dv* -l
fdisk -l /dev/sda
ls -lF /dev/{random,urandom,zero,null}
REMEMBER: Evertrhing is a file (sockets, process, devices, etc)
It was awesome so other developer start using it to save information like cpu, memory, kernel configuration.
Until kernel 2.5 camedout ... (sysfs)
Hint: When you read from /proc, the kernel generates content on the fly. There is no hard drive involved.
ls /proc
cat /proc/cpuinfo
lscpu
cat /proc/meminfo
cat /proc/version
uname -s
uname -r
cat /proc/sys/kernel/version
cat /proc/cmdline
cat /proc/uptime
#"uptime idle"
cd /proc
ls [0-9]*/ -d
# Currently running process
# Htop, Top
yes &> /dev/null &
pidof yes
ls -d `pidof yes`
cd 10806
ls
ls -lh cwd
ls -lh exe
cat status | head -6
# A test for cwd in procfs
cd ~
mkdir webserver
dd if=/dev/zero of=file.zip bs=1M count=100
python -m SimpleHTTPServer
cd ~/Downloads
wget --limit-rate=1k http://0.0.0.0:8000/file.zip -O dl.zip
cd /proc
cd `pidof wget`
ls -l cwd
arp
# makes details more readable (converts hex)
ip n
cd /proc/net
cat arp
ls -ld /proc/net
ls -ld /proc/self
ls -ld /proc/self
cd /proc/net
pwd
pwd -P
echo $$
pidof -s bash
type cd
help cd
ls /sys
ls /sys/dev/char /sys/dev/block
# Major:Minor
# Driver:Which Device Exactly
Because of good organization by sysfs udev introduced
BEFORE UDEV: /dev exists but it was handeling by static links to thinks like: while there first pluged in then unplug but device still is there
whatis udev
[inter-process communication]
D-Bus is a message bus system, a simple way for applications to talk to one another.
With udev devices (/dev) are handled dynamicly and in a standard way
dbus:
Plug device => dbus signals to DE -> DE Knows about new device connected to system D-Bus helps coordinate process lifecycle;
# dbus-launch (1) - Utility to start a message bus from a shell script
# .xinitrc
exec dbus-launch --sh-syntax --exit-with-session ssh-agent openbox-session
ipynb
format: https://github.com/ravexina/linux-notes. html
exports of project available at: https://ravexina.github.io/linux-notes.Linux Notes by Milad As (Ravexina) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.